import store from '@/store'

// 自定义指令
export const imgerror = {
  inserted: function(el, options) {
    // console.log(el, options)
    el.onerror = () => {
      el.src = options.value
    }
  }
}

export const allow = {
  inserted: function(el, options) {
    const pints = store.state.user.userInfo.roles.points
    if (!pints.includes(options.value)) {
      el.style.display = 'none'
    }
  }
}
